package com.home.customtest.enums;

/**
 * @author XiaoBai
 * @since 2024/1/13 0013 14:42
 */
public enum SexEnum {

    WOMAN(0, "女生"), MAN(1, "男生");

    private final int sexInt;

    private final String desc;

    public int getSexInt() {
        return sexInt;
    }

    public String getDesc() {
        return desc;
    }

    public static SexEnum findByInt(int i) {
        return values()[i];
    }
    public static SexEnum findByDesc(String desc) {
        for (SexEnum sexEnum : values()) {
            if (sexEnum.getDesc().contains(desc)) {
                return sexEnum;
            }
        }
        return null;
    }

    SexEnum(int sexInt, String desc) {
        this.sexInt = sexInt;
        this.desc = desc;
    }
}
